package com.winhxd.b2c.customer.dao;

import com.winhxd.b2c.common.domain.customer.bo.CustomerRevenueBO;
import com.winhxd.b2c.common.domain.customer.bo.CustomerWalletBO;
import com.winhxd.b2c.common.domain.customer.model.CustomerWallet;
import com.winhxd.b2c.common.domain.customer.vo.CustomerBaseCollectVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author caiyulong
 */
@Repository
public interface CustomerWalletMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CustomerWallet record);

    int insertSelective(CustomerWallet record);

    CustomerWallet selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CustomerWallet record);

    int updateByPrimaryKey(CustomerWallet record);

    /**
     * 查询用户的收益信息（总收益，积分，下线收益）
     * @param customerId
     * @param level
     * @return
     */
    CustomerRevenueBO selectCustomerRevenueByCustomerId(@Param("customerId") Long customerId, @Param("level") Integer level);

    CustomerWallet selectByCustomerIdAndLevel(@Param("customerId") Long customerId, @Param("level") Integer level);

    List<CustomerWallet> selectByCustomerIdList(@Param("customerIdList") List<Long> customerIdList);

    void batchInsert(@Param("customerWalletList") List<CustomerWallet> customerWalletList);

    void batchUpdate(@Param("customerWalletList") List<CustomerWallet> customerWalletList);

    List<CustomerBaseCollectVO> findCustomerWallet(@Param("wallets") List<CustomerWalletBO> wallets);

    CustomerWallet selectByCustomerId(@Param("customerId") Long customerId);
}